

class A
{
    constructor() {
        this.text = "hello";
    }

    onEvent() {
        console.log(this.text);
    }

    getOnEvent() {
        //bind is nessenary or 'this' is invalid in onEvent callback
        return this.onEvent.bind(this);
    }
}

export function member_function_callback() {

    var a = new A();
    var cb = a.getOnEvent();
    cb();
}

